const CracoLessPlugin = require('craco-less');
const path = require('path');
const SimpleProgressWebpackPlugin = require('simple-progress-webpack-plugin');

module.exports = {
    eslint: {
        enable: false
    },
    webpack: {
        plugins: [
            new SimpleProgressWebpackPlugin(),
        ],
        alias: {
            '@@': path.resolve('.'),
            '@': path.resolve('.', 'src')
        },
        configure: (webpackConfig, { env }) => {
            webpackConfig.output.publicPath = '';
            return webpackConfig;
        },
    },
    plugins: [
        {
            plugin: CracoLessPlugin,
            options: {
                cssLoaderOptions: {
                    modules: {
                        exportLocalsConvention: 'dashesOnly',
                        auto: /src/
                    },
                    sourceMap: true,
                },
                lessLoaderOptions: {
                    lessOptions: {
                        javascriptEnabled: true,
                    },
                },
                miniCssExtractPluginOptions:{
                    publicPath:'../../'
                }
            }
        }
    ]
};
